import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import './assets/fonts/iconfont.css'
import './assets/css/base.css'
import { Icon, Tabbar, TabbarItem, Swipe, SwipeItem, Grid, GridItem, PullRefresh, List, NavBar, GoodsAction, GoodsActionIcon, GoodsActionButton, Popup, Card, Stepper, Button, Form, Field, Checkbox, SwipeCell, SubmitBar, Sidebar, SidebarItem, AddressEdit, AddressList, Lazyload, ContactCard, Search } from 'vant'
import loading from './plugins/loading'
// 把路径提前引入
import img from '../src/assets/456.jpg'

Vue.use(loading)

// 可以将axios挂载到原型上
// Vue.prototype.$http = axios

Vue.use(Icon)
  .use(Tabbar)
  .use(TabbarItem)
  .use(Swipe)
  .use(SwipeItem)
  .use(Grid)
  .use(GridItem)
  .use(PullRefresh)
  .use(List)
  .use(NavBar)
  .use(GoodsAction)
  .use(GoodsActionIcon)
  .use(GoodsActionButton)
  .use(Popup)
  .use(Card)
  .use(Stepper)
  .use(Button)
  .use(Form)
  .use(Field)
  .use(Checkbox)
  .use(SwipeCell)
  .use(SubmitBar)
  .use(Sidebar)
  .use(SidebarItem)
  .use(AddressEdit)
  .use(AddressList)
  .use(ContactCard)
  .use(Search)
  .use(Lazyload, { // 不能直接引入路径,因为项目运行的时候会把assets编译成base64,再运行use,这时候assets已经编译完成了,没有assets了
    // 可以用require引入,因为require是同步的,只能在编译之前引入
    // loading: require('../src/assets/456.jpg'),
    loading: img,
    error: '',
    preload: '1'
  })
Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
